import 'dart:convert';

class TiebaResponse<T> {
  int code;
  String msg;
  T result;
  String time;

  TiebaResponse({
    required this.code,
    required this.msg,
    required this.result,
    required this.time,
  });

  factory TiebaResponse.fromMap(Map<String, dynamic> map) {
    return TiebaResponse(
        code: map['code'],
        msg: map['msg'],
        result: map['result'],
        time: map['time']);
  }

  factory TiebaResponse.fromJson(String data) =>
      TiebaResponse.fromMap(jsonDecode(data));
}
